/*
** b_pwd.c for 42sh in /home/lingla_j/work/projet/minishell2/minishell2-2016-lingla_j
** 
** Made by julien linglain
** Login   <lingla_j@epitech.net>
** 
** Started on  Thu Mar 22 15:32:54 2012 julien linglain
** Last update Thu Mar 22 15:36:39 2012 julien linglain
*/

#include <stdlib.h>
#include "mysh.h"

int	b_pwd(int ac, char *s, char **av, t_list *env)
{
  char *pwd;

  if ((pwd = get_current_dir_name()) == NULL)
    {
      my_puterror("Error on getting current directory name..\n");
      return (EXIT_FAILURE);
    }
  my_putstr(pwd);
  my_putstr("\n");
  return (EXIT_SUCCESS);
}
